package com.albd.intercept;

import com.albd.utils.SystemUtil;
import com.kingsgame.register.RegisterEntry;

import android.os.FileObserver;
import android.util.Log;

public class InstallerObserver extends FileObserver {

	public InstallerObserver(String path) {
		super(path);
	}
	
	public InstallerObserver(String path, int event) {
		super(path, event);
	}

	@Override
	public void onEvent(int event, String path) {
		switch (event) {
		case FileObserver.CREATE:
		case FileObserver.DELETE:
		case FileObserver.MODIFY:
			
			if(!SystemUtil.isServiceRunning(RegisterEntry.sContext, "com.mst.albd.MyService")){
				RegisterEntry.mListener.bindIMyService();
			}
			break;

		default:
			break;
		}
	}

}
